package 多线程;

import static java.lang.Thread.sleep;

class MyRunnable implements Runnable {

    @Override
    public void run() {
        while(true){
            System.out.println("Runnable");
            try {
                sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
public class Eemo2 {
    public static void main(String[] args) {
        Thread t = new Thread(new MyRunnable());
        t.start();

        while(true){
            System.out.println("Main");
            try {
                sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
